import cx from 'classnames';
import React from 'react';

import Pagination from '../../../Pagination';

import { prefix } from '../../../config';
import { getPrefixCls } from '../../../utils';

import type { PaginationProps } from '../../../Pagination';

type Props = PaginationProps;

const defaultPagination: PaginationProps = {
  defaultCurrent: 1,
  defaultPageSize: 10,
  showSizeChanger: true,
  showTotal: (total) => `共 ${total} 条`,
};
function TablePagination(props: Props) {
  const { ...paginationProps } = props;
  const prefixCls = getPrefixCls(prefix.editableTable, 'pagination');

  return (
    <div className={cx(prefixCls)}>
      <Pagination {...defaultPagination} {...paginationProps} />
    </div>
  );
}

export default TablePagination;
